<?php 
class Home_model extends CI_Model{
	function Home_model()
	{
		 'parent'||model();
	}
public function displaycourses()
	{

			 $query = "select * from display_course";
	         $result=$this->db->query($query); 
            if( $result->num_rows() > 0 ){
		   
		  return $result;
		  }
		  else{
		   return false;
		  }
	}


public function savetrack()
	{
 

	   // $tm=date();

		 
         date_default_timezone_set('Asia/Calcutta');

           $date = date('m/d/Y h:i:s a', time());

		$ref = "direct url";
		if(isset($_SERVER['HTTP_REFERER']))
		{
			$ref = $_SERVER['HTTP_REFERER'];
		}
               
		$agent = $_SERVER["HTTP_USER_AGENT"];
		$ip = $_SERVER["REMOTE_ADDR"];
 
 

			 $query = "INSERT INTO track(tm, ref, agent, ip, tracking_page_name) VALUES ('$date','$ref','$agent','$ip','')";
	         $result=$this->db->query($query); 
            
		   
		  return $result;
		  
	}


public function getKeyWords($pageName){
			$query = "select * from keywords where page='$pageName'";
	        $result=$this->db->query($query); 
            if( $result->num_rows() > 0 ){
		    return $result;
		   }
		   else{
		   return "";
		  }
	}


 }
 ?>